#[doc = "Register `UART_RIS` reader"]
pub struct R(crate::R<UART_RIS_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<UART_RIS_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<UART_RIS_SPEC>> for R {
    fn from(reader: crate::R<UART_RIS_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Raw overflow error interrupt state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OERIS_A {
    #[doc = "0: No interrupt is generated."]
    NO_INTERRUPT = 0,
    #[doc = "1: An interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<OERIS_A> for bool {
    #[inline(always)]
    fn from(variant: OERIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `oeris` reader - Raw overflow error interrupt state."]
pub struct OERIS_R(crate::FieldReader<bool, OERIS_A>);
impl OERIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        OERIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OERIS_A {
        match self.bits {
            false => OERIS_A::NO_INTERRUPT,
            true => OERIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == OERIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == OERIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for OERIS_R {
    type Target = crate::FieldReader<bool, OERIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Raw break error interrupt state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BERIS_A {
    #[doc = "0: No interrupt is generated."]
    NO_INTERRUPT = 0,
    #[doc = "1: An interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<BERIS_A> for bool {
    #[inline(always)]
    fn from(variant: BERIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `beris` reader - Raw break error interrupt state."]
pub struct BERIS_R(crate::FieldReader<bool, BERIS_A>);
impl BERIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        BERIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BERIS_A {
        match self.bits {
            false => BERIS_A::NO_INTERRUPT,
            true => BERIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == BERIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == BERIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for BERIS_R {
    type Target = crate::FieldReader<bool, BERIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Raw parity interrupt state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PERIS_A {
    #[doc = "0: No interrupt is generated."]
    NO_INTERRUPT = 0,
    #[doc = "1: An interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<PERIS_A> for bool {
    #[inline(always)]
    fn from(variant: PERIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `peris` reader - Raw parity interrupt state."]
pub struct PERIS_R(crate::FieldReader<bool, PERIS_A>);
impl PERIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        PERIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PERIS_A {
        match self.bits {
            false => PERIS_A::NO_INTERRUPT,
            true => PERIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == PERIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == PERIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for PERIS_R {
    type Target = crate::FieldReader<bool, PERIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Raw error interrupt state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FERIS_A {
    #[doc = "0: No interrupt is generated."]
    NO_INTERRUPT = 0,
    #[doc = "1: An interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<FERIS_A> for bool {
    #[inline(always)]
    fn from(variant: FERIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `feris` reader - Raw error interrupt state."]
pub struct FERIS_R(crate::FieldReader<bool, FERIS_A>);
impl FERIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        FERIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FERIS_A {
        match self.bits {
            false => FERIS_A::NO_INTERRUPT,
            true => FERIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == FERIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == FERIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for FERIS_R {
    type Target = crate::FieldReader<bool, FERIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Raw RX timeout interrupt state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RTRIS_A {
    #[doc = "0: No interrupt is generated."]
    NO_INTERRUPT = 0,
    #[doc = "1: An interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<RTRIS_A> for bool {
    #[inline(always)]
    fn from(variant: RTRIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `rtris` reader - Raw RX timeout interrupt state."]
pub struct RTRIS_R(crate::FieldReader<bool, RTRIS_A>);
impl RTRIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        RTRIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RTRIS_A {
        match self.bits {
            false => RTRIS_A::NO_INTERRUPT,
            true => RTRIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == RTRIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == RTRIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for RTRIS_R {
    type Target = crate::FieldReader<bool, RTRIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Raw TX interrupt state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXRIS_A {
    #[doc = "0: No interrupt is generated."]
    NO_INTERRUPT = 0,
    #[doc = "1: An interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<TXRIS_A> for bool {
    #[inline(always)]
    fn from(variant: TXRIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `txris` reader - Raw TX interrupt state."]
pub struct TXRIS_R(crate::FieldReader<bool, TXRIS_A>);
impl TXRIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        TXRIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TXRIS_A {
        match self.bits {
            false => TXRIS_A::NO_INTERRUPT,
            true => TXRIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == TXRIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == TXRIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for TXRIS_R {
    type Target = crate::FieldReader<bool, TXRIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Raw RX interrupt state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXRIS_A {
    #[doc = "0: No interrupt is generated."]
    NO_INTERRUPT = 0,
    #[doc = "1: An interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<RXRIS_A> for bool {
    #[inline(always)]
    fn from(variant: RXRIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `rxris` reader - Raw RX interrupt state."]
pub struct RXRIS_R(crate::FieldReader<bool, RXRIS_A>);
impl RXRIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        RXRIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RXRIS_A {
        match self.bits {
            false => RXRIS_A::NO_INTERRUPT,
            true => RXRIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == RXRIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == RXRIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for RXRIS_R {
    type Target = crate::FieldReader<bool, RXRIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bit 10 - Raw overflow error interrupt state."]
    #[inline(always)]
    pub fn oeris(&self) -> OERIS_R {
        OERIS_R::new(((self.bits >> 10) & 0x01) != 0)
    }
    #[doc = "Bit 9 - Raw break error interrupt state."]
    #[inline(always)]
    pub fn beris(&self) -> BERIS_R {
        BERIS_R::new(((self.bits >> 9) & 0x01) != 0)
    }
    #[doc = "Bit 8 - Raw parity interrupt state."]
    #[inline(always)]
    pub fn peris(&self) -> PERIS_R {
        PERIS_R::new(((self.bits >> 8) & 0x01) != 0)
    }
    #[doc = "Bit 7 - Raw error interrupt state."]
    #[inline(always)]
    pub fn feris(&self) -> FERIS_R {
        FERIS_R::new(((self.bits >> 7) & 0x01) != 0)
    }
    #[doc = "Bit 6 - Raw RX timeout interrupt state."]
    #[inline(always)]
    pub fn rtris(&self) -> RTRIS_R {
        RTRIS_R::new(((self.bits >> 6) & 0x01) != 0)
    }
    #[doc = "Bit 5 - Raw TX interrupt state."]
    #[inline(always)]
    pub fn txris(&self) -> TXRIS_R {
        TXRIS_R::new(((self.bits >> 5) & 0x01) != 0)
    }
    #[doc = "Bit 4 - Raw RX interrupt state."]
    #[inline(always)]
    pub fn rxris(&self) -> RXRIS_R {
        RXRIS_R::new(((self.bits >> 4) & 0x01) != 0)
    }
}
#[doc = "UART_RIS is the raw interrupt state register.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [uart_ris](index.html) module"]
pub struct UART_RIS_SPEC;
impl crate::RegisterSpec for UART_RIS_SPEC {
    type Ux = u16;
}
#[doc = "`read()` method returns [uart_ris::R](R) reader structure"]
impl crate::Readable for UART_RIS_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets UART_RIS to value 0x0f"]
impl crate::Resettable for UART_RIS_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0x0f
    }
}
